<template>
  <div>
    <CommentMain
      :commentData="comment"
      v-for="(comment, index) in commentList"
      :key="index"
    />
  </div>
</template>

<script>
import CommentMain from "../components/commet/main";
export default {
  data() {
    return {
      // 评论列表时一个数组,
      // 里面每个评论都是一个对象
      commentList: [],
    };
  },
  components: {
    CommentMain,
  },
  created() {
    this.$axios({
      url: "/post_comment/" + 1,
    }).then((res) => {
      console.log(res.data);
      this.commentList = res.data.data;
    });
  },
};
</script>

<style>
</style>